<div class="release-app-wrap" id="mySignInnerList">
    <div class="signature1">
        <!--面包屑导航-->
        <div class="crumbs iframe-crumbs">
            <img class="crumbs_icon" src="./static/crumbs_icon.png">
            <a href="./sign">企业签名</a><span>/</span>我的签名
        </div>
        <!--/面包屑导航-->
        
        <!--签名流程-->
        <div class="con">
            <div class="clearfix">
                <div class=" left-collapse-box sidebar-fixed">
                    <div class="left">
                        <ul>
                            <li><a href="javascript:void(0);" class="left-collapse-title"><img src="./static/right_bold.png">企业签名</a></li>
                            <li>
                                <a href="javascript:;" id="uploadApple" onclick="switchTab('uploadApple')" >
                                    <span class="iconfont icon-upload1"></span>
                                    上传苹果应用
                                </a>
                            </li>
                            <li class="active">
                                <a href="javascript:;">
                                    <span class="iconfont icon-qianming"></span>
                                    我的签名
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="right-collapse-box">
                    <div class="right">
                        <div class="table-list-wrap">
                            <div class="table-list">
                                <div class="table-responsive release-app">
                                    <table class="table app-table">
                                        <thead>
                                        <tr>
                                            <th width="195">名称</th>
                                            <th width="160">包名</th>
                                            <th width="100" class="number sorted ending" sort="">
                                                <span class="text" style="color:#304DD9">到期时间</span>
                                            </th>
                                            <th width="90">下载签名包</th>
                                            <th class="no-sort" width="230">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                                                
                                            <tr v-for="(item, index) in list" :key="index">
                                                <td>
                                                    <div class="clearfix app-icon-name">
                                                    {{item.fileName}}
                                                    </div>
                                                </td>
                                                <td>{{item.appName}}</td>
                                                <td>{{item.expireTime}}</td>
                                                <td>
                                                <a style="color: #333 !important;" class="ellipsis fl" data-container="body" data-toggle="popover" data-placement="bottom" data-trigger="hover" target="_blank" 
                                                    :href="item.url" data-original-title="" title="">
                                                    {{item.url}}
                                                </a>
                                                </td>
                                                <td>
                                                    <a href="javascript:;" @click="del(item)" app_id="642224244763131904" class="table-btn color-delete">
                                                        删除
                                                    </a>
                                                </td>
                                            </tr>
                                        
                                        </tbody>
                                    </table>
                                </div>
                                
                                <div class="no-signature" v-if="list.length === 0">
                                    <img src="./static/img-16.png">
                                    <div class="text">暂无签名记录</div>
                                </div>
                                    
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--/签名流程-->
    </div>
</div>


<script>
  
    new Vue({
      el: '#mySignInnerList',
      data: {
        list: [],
        searchKey: '',
        loading: null,
      },
      mounted() {
        this.query();
      },
      methods: {
          del(item){
            
            this.loading = this.$loading({
                lock: true,
                // text: '加载中',
                spinner: 'el-icon-loading',
              });
              axios({
                  method: "POST",
                  url: baseUrl + "/pkg/delete",
                  headers: {
                    authorization: localStorage.getItem("token")
                  },
                  data: {
                    id: item.id,
                  },
              }).then(({ data }) => {
                this.loading.close();
                if (data.code === 200) {
                    this.$message({
                        message: '删除成功',
                        type: "success",
                    });
                    this.query();
                } else {
                    this.$message({
                        message: data.message,
                        type: "warning",
                    });
                }
              });
          },
          query(){
            
            this.loading = this.$loading({
                lock: true,
                text: '加载中',
                spinner: 'el-icon-loading',
              });
              axios({
                  method: "POST",
                  url: baseUrl + "/pkg/list",
                  headers: {
                    authorization: localStorage.getItem("token")
                  },
                  data: {
                    order: "",
                    orderBy: "",
                    appName: this.searchKey, // 
                    pageSize: 100000000, // 
                    pageNum: 1, // 
                    type: 2
                  },
              }).then(({ data }) => {
                this.loading.close();
                if (data.code === 200) {
                    this.list = data.result.records;
                } else {
                    this.$message({
                        message: data.message,
                        type: "warning",
                    });
                }
              });
          },
          
      },
    })
  </script>


<style>
    html{
        background-color: #FAFAFB;
    }
</style>